/* 
 * Copyright (C), 2016-2020, 厦门盈欣宝金融信息服务有限公司
 * Project Name :boot-parent
 * File Name: org.easytouesit.mongodb.service
 * Encoding UTF-8 
 * Version: 1.0 
 * Date: 2018-08-27 15:58
 * History:  
 * 1. Date: 2018-08-27
 *    Author: guojm 
 *    Modification: 新建
 * 2. ...
 */
package org.easytouesit.mongodb.service;

import org.easytouesit.mongodb.dao.UserDao;
import org.easytouesit.mongodb.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author guojm
 * @version V1.0
 * @date 2018-08-27 下午 15:58
 */
@Service("userService")
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;
    @Override
    public List<User> findAll() {
        return userDao.findAll();
    }

    @Override
    public User getUser(Integer id) {
        return userDao.getUser(id);
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void insert(User user) {
        userDao.insert(user);
    }

    @Override
    public void insertAll(List<User> users) {
        userDao.insertAll(users);
    }

    @Override
    public void remove(Integer id) {
        userDao.remove(id);
    }

    @Override
    public List<User> findByPage(User user, Pageable pageable) {
        return userDao.findByPage(user,pageable);
    }
}
